import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import HotMovie from '../views/HotMovie.vue'
import WillMovie from '../views/WillMovie.vue'
import TopMovie from '../views/TopMovie.vue'
import DetailMovie from '../views/DetailMovie.vue'

Vue.use(VueRouter)

// 路由映射
const routes = [{
  path: '/',
  component: Home,
  redirect: '/hot',
  children: [
    { path: 'hot', component: HotMovie },
    { path: 'will', component: WillMovie },
    { path: 'top', component: TopMovie },
    { path: 'detail', component: DetailMovie }
  ]
}]

const router = new VueRouter({
  routes
})

export default router
